package com.tingyuge.base.design.flyweight;

/**
 * @Created by xiaodao
 */
public class Client {

    public static void main(String[] args) {

        ChessFlyWeightFactory c =  ChessFlyWeightFactory.getInstance();

        ChessFlyWeight chess1 = c.getChess("黑色");

        chess1.display(new ChessCoordinateConcrete(10,20));

        ChessFlyWeight chess2 = c.getChess("黑色");
        System.out.println("-----------------");
        chess2.display(new ChessCoordinateConcrete(20,30));

        System.out.println(chess1);
        System.out.println(chess2);

    }

}
